package com.xszx.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 
 * @TableName t_asset
 */
@TableName(value ="t_asset")
@Data
public class TAsset implements Serializable {
    /**
     * 资产id
     */
    @TableId(type = IdType.AUTO)
    private Long aid;

    /**
     * 资产名字
     */
    private String aname;

    /**
     * 资产原价
     */
    private Double aprice;

    /**
     * 折旧率
     */
    private Double adepreciation;

    /**
     * 入库日期
     */
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date aintodate;

    /**
     * 入库部门
     */
    private String aintodept;

    /**
     * 规格型号
     */
    private String aserial;

    /**
     * 资产状态
     */
    private String astatus;

    /**
     * 现存地址
     */
    private String aaddress;
    /**
     * 资产编号
     */
    private Long acode;

    /**
     * 部门id
     */
    private long did;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TAsset other = (TAsset) that;
        return (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid()))
            && (this.getAname() == null ? other.getAname() == null : this.getAname().equals(other.getAname()))
            && (this.getAprice() == null ? other.getAprice() == null : this.getAprice().equals(other.getAprice()))
            && (this.getAdepreciation() == null ? other.getAdepreciation() == null : this.getAdepreciation().equals(other.getAdepreciation()))
            && (this.getAintodate() == null ? other.getAintodate() == null : this.getAintodate().equals(other.getAintodate()))
            && (this.getAintodept() == null ? other.getAintodept() == null : this.getAintodept().equals(other.getAintodept()))
            && (this.getAserial() == null ? other.getAserial() == null : this.getAserial().equals(other.getAserial()))
            && (this.getAstatus() == null ? other.getAstatus() == null : this.getAstatus().equals(other.getAstatus()))
            && (this.getAaddress() == null ? other.getAaddress() == null : this.getAaddress().equals(other.getAaddress()))
            && (this.getAcode() == null ? other.getAcode() == null : this.getAcode().equals(other.getAcode()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAid() == null) ? 0 : getAid().hashCode());
        result = prime * result + ((getAname() == null) ? 0 : getAname().hashCode());
        result = prime * result + ((getAprice() == null) ? 0 : getAprice().hashCode());
        result = prime * result + ((getAdepreciation() == null) ? 0 : getAdepreciation().hashCode());
        result = prime * result + ((getAintodate() == null) ? 0 : getAintodate().hashCode());
        result = prime * result + ((getAintodept() == null) ? 0 : getAintodept().hashCode());
        result = prime * result + ((getAserial() == null) ? 0 : getAserial().hashCode());
        result = prime * result + ((getAstatus() == null) ? 0 : getAstatus().hashCode());
        result = prime * result + ((getAaddress() == null) ? 0 : getAaddress().hashCode());
        result = prime * result + ((getAcode() == null) ? 0 : getAcode().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", aid=").append(aid);
        sb.append(", aname=").append(aname);
        sb.append(", aprice=").append(aprice);
        sb.append(", adepreciation=").append(adepreciation);
        sb.append(", aintodate=").append(aintodate);
        sb.append(", aintodept=").append(aintodept);
        sb.append(", aserial=").append(aserial);
        sb.append(", astatus=").append(astatus);
        sb.append(", aaddress=").append(aaddress);
        sb.append(", acode=").append(acode);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}